package com.esd.db.dao;

import java.util.List;
import java.util.Map;

import com.esd.db.model.user;

public interface userMapper {
   
    int deleteByPrimaryKey(Integer userId);

    int insert(user record);

    int insertSelective(user record);

    user selectByPrimaryKey(Integer userId);
    
    List<user> selectAllUsers();
    
    int selectUserIdByUserName(String username);
    
    int selUserTypeByUserName(String username);
    
    user selectAllUsersByUserName(String username);
    
    int getMaxUserId();

    int updateByPrimaryKeySelective(user record);

    int updateByPrimaryKey(user record);
    
    int selectAllUserCount();
    
    int selectAllUserCountByUserType(Integer userType);
    
    int selectUserIdCountByUserName(String userName);
    
    user selectByUserName(String userName);
    
    List<user> selectLikeUsername(Map<String,Object> map);
    
    int selectCountLikeUsername(Map<String,Object> map);
    
    List<Map<String,Object>> selectWorkerSalary(Map<String,Object> map);
    
    int updateWorkerLvl(Map<String,Object> map);

	int selectReferralNumByUserId(int userId);

	List<user> selectReferralUsers(Map<String, Object> map);
	
	int selectReferralUsersCount(Map<String, Object> map);

	int updateReferrerIdByUserId(Map<String, Object> map);

	int insertSelectiveReturnUserId(user record);

	int updateWorkGroupByUserId(Map<String, Object> map);
	
	/**
	 * 根据工作组代码 修改用户状态
	 * @param map
	 * @return
	 */
	int changeUserStatus(Map<String, Object> map);
}